/**********************************************
 * 
 * File Name				:	MenuDAOImpl.java
 * 
 * Last Changed Date		: 	$Date: 2009-08-06 14:51:00 +0800 (星期四, 06 八月 2009) $
 * 
 * Last Changed Revision	:	$Revision: 92 $
 * 
 * Last Changed Author		:	$Author: cfanboy $
 * 
 * File Header URL			:	$HeadURL: svn://www.svnhost.cn/Busi-Building/code/branch/src/com/busibuilding/administrate/menu/dao/MenuDAOImpl.java $
 * 
 * ********************************************
 */

package com.busibuilding.administrate.menu.dao;

import java.util.List;

import com.busibuilding.administrate.menu.vo.MenuCVO;
import com.busibuilding.common.dao.CommonDaoImpl;
import com.busibuilding.common.exceptions.DAOException;
import com.busibuilding.common.vo.ICommonVO;

/**
 * Class Name: MenuDAOImpl.java
 * Description: 
 * @author YU Zhipeng
 * @version 1.0
 * @since 1.0
 * Date: 2009-7-26
 */
@SuppressWarnings("unchecked")
public class MenuDAOImpl extends CommonDaoImpl implements MenuDAO {

	@Override
	public int getRecordsCount(ICommonVO vo) throws DAOException {
		int result = SQLMAP_COMMON_RESULT_ERROR;
		result = (Integer)queryObject(CMD_SQL_MAP_MENU_COUNT_RECORDS, vo);
		return result;
	}

	@Override
	public int delete(ICommonVO vo) throws DAOException {
		int result = SQLMAP_COMMON_RESULT_ERROR;
		result = delete(CMD_SQL_MAP_MENU_DELETE, vo);
		return result;
	}

	@Override
	public int insert(ICommonVO vo) throws DAOException {
		int result = SQLMAP_COMMON_RESULT_ERROR;
		result = (Integer)insert(CMD_SQL_MAP_MENU_INSERT, vo);
		return result;
	}

	@Override
	public List<MenuCVO> searchMenuByCondition(ICommonVO vo)
			throws DAOException {
		return queryList(CMD_SQL_MAP_MENU_SEARCH, vo);
	}

	@Override
	public List<MenuCVO> searchMenuByCondition(ICommonVO vo, int skipResults,
			int maxResults) throws DAOException {
		return queryList(CMD_SQL_MAP_MENU_SEARCH, vo, skipResults, maxResults);
	}
	

	@Override
	public int update(ICommonVO vo) throws DAOException {
		int result = SQLMAP_COMMON_RESULT_ERROR;
		result = update(CMD_SQL_MAP_MENU_UPDATE, vo);
		return result;
	}

}
